home *** CD-ROM | disk | FTP | other *** search
- package com.sun.java.swing.text;
-
- import com.sun.java.swing.event.DocumentEvent;
- import com.sun.java.swing.undo.AbstractUndoableEdit;
- import com.sun.java.swing.undo.CannotRedoException;
- import com.sun.java.swing.undo.CannotUndoException;
-
- public class AbstractDocument$ElementEdit extends AbstractUndoableEdit implements DocumentEvent.ElementChange {
- // $FF: renamed from: e com.sun.java.swing.text.Element
- private Element field_0;
- private int index;
- private Element[] removed;
- private Element[] added;
-
- public AbstractDocument$ElementEdit(Element e, int index, Element[] removed, Element[] added) {
- this.field_0 = e;
- this.index = index;
- this.removed = removed;
- this.added = added;
- }
-
- public Element getElement() {
- return this.field_0;
- }
-
- public int getIndex() {
- return this.index;
- }
-
- public Element[] getChildrenRemoved() {
- return this.removed;
- }
-
- public Element[] getChildrenAdded() {
- return this.added;
- }
-
- public void redo() throws CannotRedoException {
- super.redo();
- Element[] tmp = this.removed;
- this.removed = this.added;
- this.added = tmp;
- ((AbstractDocument.BranchElement)this.field_0).replace(this.index, this.removed.length, this.added);
- }
-
- public void undo() throws CannotUndoException {
- super.undo();
- ((AbstractDocument.BranchElement)this.field_0).replace(this.index, this.added.length, this.removed);
- Element[] tmp = this.removed;
- this.removed = this.added;
- this.added = tmp;
- }
- }
-